// 编辑游湖
const conn = require('./conn.js')
module.exports = (req, res) => {
    setTimeout(() => {
        // 获取客户端传过来的参数
        let id = req.body.id,
            username = req.body.username,
            email = req.body.email,
            phone = req.body.phone,
            sex = req.body.sex  
            console.log(id)
            console.log(username)
        sql = 'update `usernode` set ? where `id`="' + id + '"'
        conn.query(sql, {username,email,phone,sex},function (error, result) {
            if (error == null) {
                res.json({
                    error: 0,
                    message: 'ok',
                })
            } else {
                console.log(error)
                res.json({
                    error: 1,
                    message: 'error'
                })
            }
        })
    }, 0)
}
